package com.tarena.dang.actions.cart;

import java.util.List;

import com.tarena.dang.actions.BaseAction;
import com.tarena.dang.pojos.CartItem;
import com.tarena.dang.services.CartFactory;
import com.tarena.dang.services.CartService;

public class CartListAction extends BaseAction {
	private List<CartItem> buyList;
	private List<CartItem> delList;
	private double totalPrice;
	private double savePrice;

	public String execute() {
		CartService cart = CartFactory.getCart(session);
		buyList = cart.getBuyList();
		delList = cart.getDelList();
		totalPrice = cart.count();
		savePrice = cart.countSavePrice();
		return "success";
	}

	public double getSavePrice() {
		return savePrice;
	}

	public void setSavePrice(double savePrice) {
		this.savePrice = savePrice;
	}

	public List<CartItem> getBuyList() {
		return buyList;
	}

	public void setBuyList(List<CartItem> buyList) {
		this.buyList = buyList;
	}

	public List<CartItem> getDelList() {
		return delList;
	}

	public void setDelList(List<CartItem> delList) {
		this.delList = delList;
	}

	public double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(double totalPrice) {
		this.totalPrice = totalPrice;
	}
}
